package com.movie.demo.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.movie.demo.pojo.Discuss;
import com.movie.demo.pojo.vo.DiscussInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DiscussMapper extends BaseMapper<Discuss> {

    @Select("select a.did,a.uid,a.mid,b.name,b.avatar,a.content,a.distime from discuss a ,user b where a.uid=b.uid and mid=#{mid} order by distime desc")
    List<DiscussInfo> Selectdiscuss(Integer mid);
    @Select("select a.did,b.account,c.chinese_name,b.name,b.avatar,a.content,a.distime from discuss a ,user b,movie c where a.uid=b.uid and a.mid=c.mid order by distime desc")
    List<DiscussInfo> AllSelect();
}
